﻿using Models;
using Models.DTO;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace IBLL
{
    /// <summary>
    /// 商店商品信息表
    /// </summary>
    public interface ICommodityInfoBLL
    {
        /// <summary>
        /// 新增的方法
        /// </summary>
        /// <param name="commodityInfo"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        bool CreateCommodityInfo(CommodityInfo commodityInfo, out string msg);

        /// <summary>
        /// 获取
        /// </summary>
        /// <param name="page">第几页</param>
        /// <param name="limit">每页几条数据</param>
        /// <param name="commodityName">名称模糊查询条件</param>
        /// <param name="count">数据总数</param>
        /// <returns></returns>
        List<GetCommodityInfoDTO> GetCommodityInfoList(int page, int limit, string commodityName, out int count);

        /// <summary>
        /// 编辑
        /// </summary>
        /// <param name="commodityInfo"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        bool UpdateCommodityInfo(CommodityInfo commodityInfo, out string msg);

        /// <summary>
        /// 软删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool DeleteCommodityInfo(string id);

        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
      //  bool DeleteCommodityInfos(List<string> ids);


        /// <summary>
        /// 上传Excel
        /// </summary>
        /// <param name="stream"></param>
        /// <param name="extension"></param>
        /// <param name="userId"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        bool Upload(Stream stream, string extension, string userId, out string msg);

        /// <summary>
        /// 获取列表分类
        /// </summary>
        /// <returns></returns>
        List<ProductType> Getcon();

        /// <summary>
        /// Excel导出出库记录
        /// </summary>
        /// <param name="dowloadFileName">下载文件 </param>
        /// <returns></returns>
        Stream GetDowload(out string dowloadFileName, string staffName);

        /// <summary>
        /// 购买商品
        /// </summary>
        /// <param name="commodityInfo"></param>
        /// <param name="userId"></param>
        /// <param name="record"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        bool Purchase(string userId, string userName, string productId, out string msg);


        /// <summary>
        /// 返回商品类别信息下拉列表的数据
        /// </summary>
        /// <returns></returns>
        object GetSelectOptions();

    }
}
